// => sort

#pragma once
#ifndef __SORT_H__
#define __SORT_H__

// Includes

#include <stddef.h>

// Macros

typedef int ElemType;

// Functions

/// @func: BubbleSort
/// >> sort array by bubble sort algorithm
/// @param: <array> the array [ ElemType * ]
/// @param: <start> the start of range [ size_t ]
/// @param: <end> the end of range [ size_t ]
/// @descript: this function will change the original array
void BubbleSort(ElemType *array, size_t start, size_t end);

/// @func: BubbleSortM
/// >> sort array by bubble sort algorithm using specified method
/// @param: <array> the array [ ElemType * ]
/// @param: <start> the start of range [ size_t ]
/// @param: <end> the end of range   [ size_t ]
/// @param: <m> the method [ int (*)(ElemType, ElemType) ]
/// @descript:
///   * this function will change the original array
///   * the method will return -1, 0 and 1 for LT, EQ, GT
void BubbleSortM(ElemType *array, size_t start, size_t end,
                 int (*m)(ElemType, ElemType));

#endif